package com.parking.carsystem.parkingchargesystem.activity;

import android.os.Bundle;
import android.webkit.WebView;
import android.widget.ImageView;
import android.widget.TextView;

import com.parking.carsystem.parkingchargesystem.R;
import com.parking.carsystem.parkingchargesystem.common.Constant;

import butterknife.BindView;
import butterknife.ButterKnife;

public class PrivacyAgreementActivity extends BaseActivity {
    @BindView(R.id.back)
    ImageView back;
    @BindView(R.id.text)
    TextView text;
    @BindView(R.id.webview)
    WebView webview;
    private boolean choosePrivacy;

    @Override
    protected int getContentViewId() {
        return R.layout.activity_agreement;
    }

    @Override
    public void initView() {
        choosePrivacy = getIntent().getBooleanExtra(Constant.CHOOSE_PRIVACY, false);
    }

    @Override
    public void initData() {
        String url = null;
        if (choosePrivacy) {
            text.setText("注册协议");
            url = "file:////android_asset/ky_registration_agreement.html";
        } else {
            url = "file:////android_asset/ky_privacy_policy.html";
            text.setText("隐私政策");
        }
        // 加载apk包中的html页面
        webview.loadUrl(url);
    }
}
